from PIL import Image	

im = Image.open("image.jpg")
print(im.format, im.size, im.mode);

new_photo = im.copy();
new_photo.thumbnail(im.size, resample=Image.ANTIALIAS);

save_args = {'format': im.format};
if im.format == "JPEG":
    save_args["quality"] = 85
    save_args["optimize"] = True
    save_args["progressive"] = True

new_photo.save("image2.jpg", **save_args)
